<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<?php
date_default_timezone_set('Europe/Kiev');
require "header.inc"
?>
<body>

<script type="text/javascript">

if (!(/MSIE (5\.5|6).+Win/.test(navigator.userAgent)))
 {var objContainer = document.getElementsByTagName('head')[0];

 var objLink = document.createElement('link');
 objLink.setAttribute('rel', 'stylesheet');
 objLink.setAttribute('type', 'text/css');
 objLink.setAttribute('href', 'stylesheet_alpha.css');
 objContainer.appendChild(objLink);
}

if(document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth > 1444)
document.body.className="bg2k";
</script>

<?php
require "coordinates.inc"
?>

<table border="0" width="100%"><tbody><tr><td>&nbsp;</td><td width="900">
<div id="opt-b">

<div class="boxhead-opt">Наши курсы</div>
<table cellpadding="1" cellspacing="0" border="0" width="300">
<tbody><tr>
<td></td><td class="paybay">покупка</td><td class="paybay">/</td><td class="paybay">продажа</td>
</tr>

<?php
define ("USERNAME", "oleg");
define ("PASSWORD", "oleg4321");
define ("DBNAME", "oleg");
define ("SERVER", "localhost");
$link=mysqli_connect(SERVER, USERNAME, PASSWORD, DBNAME);
if (!$link) {echo "Error DB"; 	exit();};
$result=mysqli_query($link, "select name currency, 
  round(`BUY_COURSE`(name, 'OUR'), 3) buy, 
  round(`SELL_COURSE`(name, 'OUR'),3) sell
from currencies order by orderby");
if ($result)
{	$rows=mysqli_num_rows($result); 
	for ($i=0;$i<$rows;$i++)
	{
		$r=mysqli_fetch_assoc($result);
		echo '<tr>';
		echo '<td>'.$r["currency"].'</td>'.'<td class="optnum-b">'.$r["buy"].'</td><td></td>'.'<td class="optnum-b">'.$r["sell"].'</td>';
		echo '</tr>';
	}
	mysqli_free_result($result);
}

?>
</tbody></table>
</div>
<div id="opt">

<div align="center" class="boxhead-opt">Наши курсы</div>
<table cellpadding="0" cellspacing="0" border="0" width="300">
<tbody>
<tr>
<td></td><td class="paybay">покупка</td><td class="paybay">/</td><td class="paybay">продажа</td>
</tr>
<?php
$result=mysqli_query($link, "select name currency, 
  round(`BUY_COURSE`(name, 'OUR'), 3) buy, 
  round(`SELL_COURSE`(name, 'OUR'),3) sell
from currencies order by orderby");
if ($result)
{	$rows=mysqli_num_rows($result); 
	for ($i=0;$i<$rows;$i++)
	{
		$r=mysqli_fetch_assoc($result);
		echo '<tr>';
		echo '<td>'.$r["currency"].'</td>'.'<td class="optnum">'.$r["buy"].'</td><td></td>'.'<td class="optnum">'.$r["sell"].'</td>';
		echo '</tr>';
	}
	mysqli_free_result($result);
}
?>
</tbody></table>
</div>


<div id="roz-b">

<div align="center" class="boxhead-roz">Розничный курс</div>
<table cellpadding="0" cellspacing="0" border="0" width="300">
<tbody><tr class="paybay">
<td></td>
<td class="paybay">покупка</td><td class="paybay">/</td><td class="paybay">продажа</td>
</tr>
<?php

$result=mysqli_query($link, "select name currency, 
  round(`BUY_COURSE`(name, 'ROZN'), 3) buy, 
  round(`SELL_COURSE`(name, 'ROZN'),3) sell
from currencies order by orderby");
if ($result)
{	$rows=mysqli_num_rows($result); 
	for ($i=0;$i<$rows;$i++)
	{
		$r=mysqli_fetch_assoc($result);
		echo '<tr>';
		echo '<td>'.$r["currency"].'</td>'.'<td class="roznum-b">'.$r["buy"].'</td><td></td>'.'<td class="roznum-b">'.$r["sell"].'</td>';
		echo '</tr>';
	}
	mysqli_free_result($result);
}
?>
</tbody></table>
</div>

<div id="roz">

<div align="center" class="boxhead-roz">Розничный курс</div>
<table cellpadding="0" cellspacing="0" border="0" width="300">
<tbody><tr>
<td></td>
<td class="paybay">покупка</td><td class="paybay">/</td><td class="paybay">продажа</td>
</tr>
<?php


$result=mysqli_query($link, "select name currency, 
  round(`BUY_COURSE`(name, 'ROZN'), 3) buy, 
  round(`SELL_COURSE`(name, 'ROZN'),3) sell
from currencies order by orderby");
if ($result)
{	$rows=mysqli_num_rows($result); 
	for ($i=0;$i<$rows;$i++)
	{
		$r=mysqli_fetch_assoc($result);
		echo '<tr>';
		echo '<td>'.$r["currency"].'</td>'.'<td class="roznum">'.$r["buy"].'</td><td></td>'.'<td class="roznum">'.$r["sell"].'</td>';
		echo '</tr>';
	}
	mysqli_free_result($result);
}
?>
</tbody></table>
</div>

<div id="cross-b">

<div align="center" class="boxhead-cross">Кросс курс</div>
<table cellpadding="0" cellspacing="0" border="0" width="300">
<tbody><tr>
<td></td>
<td class="paybay">покупка</td><td class="paybay">продажа</td>
</tr>

<?php


$result=mysqli_query($link, "select concat(name, '/USD') currency, 
  round(`BUY_COURSE`(name, 'CROSS'), 2) buy, 
  round(`SELL_COURSE`(name, 'CROSS'),2) sell
from currencies 
where (name = 'EUR' or name = 'RUR')
order by orderby");
if ($result)
{	$rows=mysqli_num_rows($result); 
	for ($i=0;$i<$rows;$i++)
	{
		$r=mysqli_fetch_assoc($result);
		echo '<tr>';
		echo '<td>'.$r["currency"].'</td>'.'<td class="crossnum-b">'.$r["buy"].'</td>'.'<td class="crossnum-b">'.$r["sell"].'</td>';
		echo '</tr>';
	}
	mysqli_free_result($result);
}
?>
</tbody></table>
</div>

<div id="cross">

<div align="center" class="boxhead-cross">Кросс курс</div>
<table cellpadding="0" cellspacing="0" border="0" width="300">
<tbody><tr>
<td></td>
<td class="paybay">покупка</td><td class="paybay">продажа</td>
</tr>

<?php


$result=mysqli_query($link, "select concat(name, '/USD') currency, 
  round(`BUY_COURSE`(name, 'CROSS'), 2) buy, 
  round(`SELL_COURSE`(name, 'CROSS'),2) sell
from currencies 
where (name = 'EUR' or name = 'RUR')
order by orderby");
if ($result)
{	$rows=mysqli_num_rows($result); 
	for ($i=0;$i<$rows;$i++)
	{
		$r=mysqli_fetch_assoc($result);
		echo '<tr>';
		echo '<td>'.$r["currency"].'</td>'.'<td class="crossnum">'.$r["buy"].'</td>'.'<td class="crossnum">'.$r["sell"].'</td>';
		echo '</tr>';
	}
	mysqli_free_result($result);
}
?>
</tbody></table>
</div>

<div id="nbu-b">

<div align="center" class="boxhead-nbu">Курс НБУ</div>
<table cellpadding="0" cellspacing="0" border="0" width="300">
<tbody>
<?php


$result=mysqli_query($link, "select name currency, 
  round(`BUY_COURSE`(name, 'NBU'), 3) buy, 
  round(`SELL_COURSE`(name, 'NBU'),3) sell
from currencies order by orderby");
if ($result)
{	$rows=mysqli_num_rows($result); 
	for ($i=0;$i<$rows;$i++)
	{
		$r=mysqli_fetch_assoc($result);
		echo '<tr>';
		echo '<td>'.$r["currency"].'</td>'.'<td class="nbunum-b">'.$r["buy"].'</td>';
		echo '</tr>';
	}
	mysqli_free_result($result);
}
?>
</tbody></table>
</div>

<div id="nbu">

<div align="center" class="boxhead-nbu">Курс НБУ</div>
<table cellpadding="0" cellspacing="0" border="0" width="300">
<tbody>
<?php


$result=mysqli_query($link, "select name currency, 
  round(`BUY_COURSE`(name, 'NBU'), 3) buy, 
  round(`SELL_COURSE`(name, 'NBU'),3) sell
from currencies order by orderby");
if ($result)
{	$rows=mysqli_num_rows($result); 
	for ($i=0;$i<$rows;$i++)
	{
		$r=mysqli_fetch_assoc($result);
		echo '<tr>';
		echo '<td>'.$r["currency"].'</td>'.'<td class="nbunum">'.$r["buy"].'</td>';
		echo '</tr>';
	}
	mysqli_free_result($result);
}
?>
</tbody></table>
</div>

<div id="forex-b">
<br><br>
<div align="center"><a href="http://www.forexpf.ru/" title="Forex: Курсы валют" target="_blank" class="forexpf_">Forex: Курсы валют</a>
</div>
<iframe src="http://www.valuta.dp.ua/inf.php" border="0" width="260" height="185" align="left" frameborder="no" style="margin-left:48px;" scrolling="no" allowtransparency="true">
    Ваш браузер не поддерживает плавающие фреймы!
 </iframe>

</div>

<div id="forex">
<br><br>
<div align="center"><a href="http://www.forexpf.ru/" title="Forex: Курсы валют" target="_blank" class="forexpf_">Forex: Курсы валют</a>
</div>
</div>


<div id="logo">obmen.kharkov.ua</div>
<?php

$result=mysqli_query($link, "select DATE_FORMAT(max(cobdate),GET_FORMAT(DATE,'EUR')) sdate from courses where source = 'OUR'");
if ($result)
{	$rows=mysqli_num_rows($result); 
	$r=mysqli_fetch_assoc($result);
    echo '<div id="today">Курсы на '.$r["sdate"].'</div>';
	mysqli_free_result($result);
}
mysqli_close($link);
?>
<div align="center" style="height: 600px;"></div>
   

<script type="text/javascript">
function locs(){
document.location.href="index.php";
}
setTimeout("locs()", 180000);

</script>

</td><td align="right" valign="top">

<div id="navigation">
<ul>
<li id="currentpage">
<a href="./index.php">
<img src="./img/cur.png" width="102" height="84" border="0" alt="Курсы" title="Курсы">
</a></li>


<li>
<a href="./statistics.php">
<img src="./img/stat.png" width="102" height="84" border="0" alt="Статистика" title="Статистика">
</a></li>

<li>
<a href="./contacts.php">
<img src="./img/contact.png" width="102" height="84" border="0" alt="Контакты" title="Контакты">
</a></li>

<li>
<a href="./news.php">
<img src="./img/news.png" width="102" height="91" border="0" alt="Новости" title="Новости">
</a> </li>

<li>
<a href="./links.php">
<img src="./img/www_kn.png" width="101" height="81" border="0" alt="Ссылки" title="Ссылки">
</a></li>

<li>
<a href="./informer.php">
<img src="./img/informer_kn.png" width="101" height="81" border="0" title="Курсы валют на Ваш сайт " alt="Информер">
</a></li>



</ul>
</div> 

&nbsp;
</td></tr></tbody></table>

<?php
require "banners.inc"
?>
</body></html>